const webpack = require('webpack')
const path = require('path')
module.exports = {
    entry: {
        library: [
            'axios',
            'monaco-editor/esm/vs/editor/editor.api.js',
            'regenerator-runtime/runtime.js'
        ],
    },
    output: {
        filename: '[name].dll.js',
        path: path.join(process.cwd(), 'build/library'),
        library: '[name]',
    },
    module: {
        rules: [{
                test: /\.js$/,
                use: [{
                        loader: 'thread-loader',
                    },
                    'babel-loader'
                ]
            },
            {
                test: /\.css$/,
                use: [
                    'style-loader',
                    'css-loader'
                ],
            },
        ]
    },
    plugins: [
        new webpack.DllPlugin({
            name: '[name]',
            context: process.cwd(),
            path: path.join(process.cwd(), 'build/library/[name].json')
        }),

    ],
    mode: 'production'
}